home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 23
/
Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso
/
Aminet
/
biz
/
misc
/
Brokerrexx.lha
/
MAKEDATAFILE.rx
< prev
next >
Wrap
Text File
|
1997-10-31
|
2KB
|
79 lines
/* Arrexx script to get current stock values for various companies */
OPTIONS RESULTS
outname = "Ram:DATA.txt"
x = open("outfile", outname, "W")
STOCKDATE = " "||DATE(usa)
IF ~OPEN("DATAFILE", "REXXSCRIPTS:STOCKLIST.RXDATA", "READ") THEN DO
SAY "DATA FILE MISSING!"
EXIT
END
DO UNTIL EOF("DATAFILE")
LINE = READLN("DATAFILE")
EPIC = WORD(LINE,1)
NAME = WORD(LINE,2)
PASS = EPIC||" "||NAME
CALL ADDDATA(PASS)
END
CLOSE("DATAFILE")
CLOSE("OUTFILE")
EXIT
ADDdata:
PASS = ARG(1)
Stock = WORD(PASS,1)
NAME = WORD(PASS,2)
file = "Ram:"||Stock
IF ~OPEN("infile",file, "R") THEN DO
SAY file " NOT FOUND!"
EXIT
END
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
PARSE VAR instr a "<h1>" Name2 "at" timenow "on" date
instr = READLN("infile")
instr = READLN("infile")
instr = READLN("infile")
instr = Right(instr,(Length(instr)-30))
PARSE VAR instr mid "</font><td>" Prev "<td>" remain
PARSE VAR remain High "<td>" Low "<td>" rem
Parse VAR rem Open "<td>" Bid "<td>" remain
PARSE VAR remain Offer "<td>" Volume "<td>" a
CLOSE("infile")
/* check that volume is present or set to zero */
IF LEFT(Volume,3)="<im" THEN DO
Volume = 0
END
first = "$Name "||NAME
second = "$FORMAT DATE_USA VOLUME HIGH LOW CLOSE OPEN"
third = STOCKDATE ||" "|| Volume " " High " " Low " " MID " " Open
say NAME STOCKDATE
a = " * "
SAY Volume a High a Low a Prev a Open a Bid a Offer a
x = WRITELN("outfile", first)
x = WRITELN("outfile", second)
x = WRITELN("outfile", third)
RETURN